package com.itmuch.contentcenter.feignclient;

import com.itmuch.contentcenter.configuration.UserCenterFeignConfiguration;
import com.itmuch.contentcenter.domain.dto.user.UserDto;
import com.itmuch.contentcenter.feignclient.fallback.UserCenterFeignClientFallback;
import com.itmuch.contentcenter.feignclient.fallbackfactory.UserCenterFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//@FeignClient(name = "user-center", configuration = UserCenterFeignConfiguration.class)

@FeignClient(name = "user-center",
    fallbackFactory = UserCenterFeignClientFallbackFactory.class
//    UserCenterFeignClientFallbackFactory
    )
public interface UserCenterFeignClient {

  @GetMapping("/users/{id}")
  UserDto findById(@PathVariable Integer id);
}
